﻿package at.geoathome.ui
{
	import flash.display.MovieClip;
	import flash.display.FrameLabel;
	
	/**
	* ...
	* @author Georg Kamptner
	*/
	public class UIUtils 
	{
		public function UIUtils(s:StaticEnforcer){
		}
		
		/*
		 * indexOfFrameLabel()
		 * @param mc 			... The movieclip which should be tested.
		 * @param frame_label 	... The FrameLabel`s Name.
		 * @return int			... Returns 0 if the label is not found, otherwise the index of the frame which contains the label.
		 */
		public static function indexOfFrameLabel(mc:MovieClip, frame_label:String):uint
		{
			var i:uint = 0;
			var l:uint = mc.currentLabels.length;
			for (; i < l;++i )
			{
				if ((mc.currentLabels[i] as FrameLabel).name == frame_label){
					return (mc.currentLabels[i] as FrameLabel).frame;
				}
			}
			
			return 0;	
		}
	}
}

class StaticEnforcer{}